# name : normal.power.n.fun power|n
# key: normal.power.n.fun
# contributor: Shuguang Sun
# --
${1:npower} <- function(x) {
  delta0 <- 0
  c <- sqrt(x$ratio)/(1 + x$ratio)
  delta <- -c * (x$delta - delta0) / x$sd
  zalpha <- qnorm(1 - x$alpha/x$sided)
  zb <- sqrt(n) * delta - zalpha
  power <- pnorm(zb)
  power
}
$1(x)